# -*- coding: utf-8 -*-
# @Time : 2022/6/15 上午11:33
# @Author : wyf
# @FileName: selenium下拉.py
# @Email: yunfei.wang@innvote.com
# 下拉数据
import time

from selenium import webdriver

driver = webdriver.Chrome()

driver.get("https://www.1688.com/")
# driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")


#
def demo():
    for y in range(1, 10):
        y = y * 500
        driver.execute_script(f"window.scrollBy(0, {y})")
        time.sleep(2)


demo()



